// SEE END OF FILE FOR LICENSE TERMS

#include "libCAN_defines.h"
#include "CANTelemetryManager_defines.h"

#ifndef TELEMETRY_MANAGER_H
#define TELEMETRY_MANAGER_H

// Intitalise telemetry manager
void initTelemetryManager(void);

// Called to trigger sending of telemetry data
// Depending on settings, triggers the appropriate telemetry queue
void CAN_send_Telemetry(void);

// Process a event sent with data identifier ID_EVENT
extern void processEvent(TELEMETRY_DATA* pteleData);

// Get the data pointer to a variable from its identifier and array offset
// The array offset acts as a index into array variables
unsigned char* get_variable_from_identifier(unsigned int identifier, unsigned int arrayOffset, unsigned int* pbyteSize);

// Same as get_variable_from_identifier but for variables specific to node
unsigned char* get_node_variable_from_identifier(unsigned int identifier, unsigned int arrayOffset, unsigned int* pbyteSize);


// Post a message in the next avaialble telemetry postbox
// return false if no postbox is available.
// Copy the refered message to the postbox
// Set write or read request status dependant on the write variable
boolean postmessage(TELEMETRY_LIST_ENTRY* pMessage, boolean write);


#endif

/****************************************************************************/
// This is part of the servo and radio interface software
//
// ServoInterface source code
//	http://code.google.com/p/rc-servo-interface
//
// Copyright 2010 ServoInterface Team
// See the AUTHORS.TXT file for a list of authors of ServoInterface.
//
// ServoInterface is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ServoInterface is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License 
// along with ServoInterface.  If not, see <http://www.gnu.org/licenses/>.
//
// Many parts of ServoInterface use either modified or unmodified code
// from the MatrixPilot pilot project.
// The project also contains code for modifying MatrixPilot to operate
// with ServoInterface.
// For details, credits and licenses of MatrixPilot see the AUTHORS.TXT file.
// or see this website: http://code.google.com/p/gentlenav
/****************************************************************************/

